import router from "./index";

router.beforeEach((to, from, next) => {
  if (to.meta.title) {
    // 浏览器 title 标签
    const faviconLink = document.querySelector(
      'link[rel="icon"][type="image/png"]'
    ) as HTMLLinkElement;
    faviconLink.href = "/favicon.png";
    document.title = to.meta.title as string;
  }
  next();
});
